package com.tiny.work.test.test;
import java.sql.Timestamp;
import java.util.Date;
/* * Java Program to compare Date and Timestamp in JDBC */
public class TimeStampVsDate {
    public static void main(String[] args) {
        Date date = new Date();
        Timestamp timestamp = new Timestamp(date.getTime());
        if (date.equals(timestamp)) {
            System.out .println("Both Date and Timestamp are equal, when you compare using Date.equals() method");
        }
        if (!timestamp.equals(date)) {
            System.out .println("But, they are not equal when you compare them using Timestamp.equals() method");
        }
    }
}

